import random

#! 元类
class MyMeta(type):
    def __new__(cls, name, bases, dct):
        print(name, bases, dct)
        return super().__new__(cls, name, bases, dct)
    
    def __init__(self, name, bases, dct):
        print(name, bases, dct)
        self.random_id = random.randint(0, 100)
        return super().__init__(name, bases, dct)
    
    def __call__(cls, *args, **kwargs):
        print("=== call ===")

class MyClass(metaclass=MyMeta):
    ...


print(MyClass.random_id)

obj = MyClass()

